#!/usr/bin/env python3

import sys
from pylab import *


def natural_numbers(limit=0):
    n = 1
    while limit == 0 or n <= limit:
        yield n
        n += 1

def parse_input(filename):
    data = []
    with open(filename, 'r') as f:
        for line in f:
            if line.startswith('#Q = '):
                data.append(int(line[5:]))
    return data

def main():
    datas = []
    for filename in sys.argv[1:]:
        datas.append(parse_input(filename))
    for data in datas:
        idx = [i + 1 for i in range(len(data))]
        plot(idx, data)

if __name__ == "__main__":
    main()
    grid()
    show()
